package com.llsydn.controller;

import com.llsydn.entity.ShopInfo;
import com.llsydn.service.AndroidService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author lilinshen
 * @title 请填写标题
 * @description 请填写相关描述
 * @date 2018/9/27 16:07
 */
@Controller
public class AndroidController {
    @Autowired
    private AndroidService androidService;

    @RequestMapping(value = "/")
    public String main() {
        return "/html/index";
    }


    @RequestMapping(value = "/index")
    public String index() {
        return "/html/index";
    }


    /**
     * 得到所有商品信息的集合
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/getAllShops")
    private List<ShopInfo> getAllShops(HttpServletRequest request) {
        return androidService.getAllShops(request);
    }

}
